package com.aya.mapper.model;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.io.support.ResourcePropertySource;
import org.springframework.stereotype.Service;

import java.io.IOException;
@Service
public class CustomInitial implements ApplicationContextInitializer<ConfigurableApplicationContext> {
    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        try {
            applicationContext.getEnvironment().getPropertySources().addLast(new ResourcePropertySource("classpath:config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
